using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using DocToolTipLib.Enums;

namespace DocToolTipLib
{


  public class ToolTipProperties
  {
    private const string CAT_APPEARENCE = "Appearance";
    private const string CAT_LAYOUT = "Layout";
    private const string CAT_CAPTION = "Caption";

    private DocToolTip _docToolTip;


    public ToolTipProperties(DocToolTip docToolTip)
    {
      _docToolTip = docToolTip;
    }

    public bool Visible
    {
      get { return _docToolTip.Visible; }
      set { _docToolTip.Visible = value; }
    }

    [Category(CAT_APPEARENCE)]
    [Description("The background color of the tooltip")]
    public Color BackColor
    {
      get { return _docToolTip.BackColor; }
      set { _docToolTip.BackColor = value; }
    }

    [Category(CAT_APPEARENCE)]
    [Description("The foreground color of the tooltip" +
                  ", which is used to display text")]
    public Color ForeColor
    {
      get { return _docToolTip.ForeColor; }
      set { _docToolTip.ForeColor = value; }
    }


    [Category(CAT_LAYOUT)]
    [DisplayName("Relative Position")]
    [Description("Relative Position")]
    public EnumRelativePositionType RelativePosition
    {
      get
      {
        return _docToolTip.RelativePositionType;
      }
      set
      {
        _docToolTip.RelativePositionType = value;
      }
    }

    [Category(CAT_LAYOUT)]
    [Description("Specifies the interior spacing of the tooltip")]
    public Padding Padding
    {
      get { return _docToolTip.Padding; }
      set { _docToolTip.Padding = value; }
    }

    [Category(CAT_APPEARENCE)]
    [Description("The font used to display text in the tooltip")]
    public Font Font
    {
      get { return _docToolTip.Font; }
      set { _docToolTip.Font = value; }
    }


    [Category(CAT_APPEARENCE)]
    [Description("The opacity percentage of the tooltip")]
    [TypeConverterAttribute(typeof(OpacityConverter))]
    public double Opacity
    {
      get { return _docToolTip.Opacity; }
      set { _docToolTip.Opacity = value; }
    }

    [Category(CAT_CAPTION)]
    [DisplayName("Caption")]
    [Description("The text associated with the tooltip")]
    public EnumToolTipCaption ToolTipCaption
    {
      get { return _docToolTip.ToolTipCaption; }
      set { _docToolTip.ToolTipCaption = value; }
    }

    [Category(CAT_CAPTION)]
    [DisplayName("Custom Caption")]
    [Description("Custom Caption\n"+
                 "%Name% : Name of component control\n" +
                 "%Type% : Type Name of component control")]
    public string CustomCaption
    {
      get { return _docToolTip.CustomCaption; }
      set { _docToolTip.CustomCaption = value; }
    }

  }
}
